<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>档案系统</title>
<!--[if lt IE 9]>
  <script src="libs/html5shiv.min.js"></script>
  <script src="libs/respond.min.js"></script>
  <![endif]-->
<script type="text/javascript" src="libs/handlebars.min.js"></script>
<script src="libs/jquery-1.12.1.min.js"></script>
<link href="libs/bootstrap-3.3.6/css/bootstrap.min.css" rel="stylesheet">
<script src="libs/bootstrap-3.3.6/js/bootstrap.min.js"></script>

<script type="text/javascript" src="libs/d3.v3.min.js"></script>
<!-- d3放在前面 -->
<script type="text/javascript" src="libs/nv.d3.min.js"></script>
<!-- nv在后面 -->
<link href="libs/bootstrap-3.3.6/css/nv.d3.min.css">
<script src="libs/jquery.backstretch.min.js"></script>
<!-- <script src="libs/js.cookie-2.1.0.min.js"></script> -->
</head>
<body>
	<div class="container">
		<div class="row">
			<div class="page-header">
				<h1 align="center">
					<strong>档案管理</strong>
				</h1>
			</div>
		</div>
	</div>
	<div class="container">
		<div class="row">
			<div class="col-md-12">
				<ul class="nav nav-pills ">
							<li class="active"><a href="#">首页</a></li>
					<li><a href="add.html"><strong>档案添加</strong></a></li>
					<li><a href="queryone.html"><strong>查询详细</strong></a></li>
            <li><a href="select.html"><strong>档案查询</strong></a></li>		
            </ul>
				<ul class="nav nav-pills pull-right">
					<li>
						<button id="quit">退出登录</button>
					</li>
				</ul>
				<div className="input-group">
					<input className="form-control" id="search-box-value"
						placeholder="档案号或身份证号" type="text" /> <span
						className="input-group-btn">
						<button className="btn btn-default" id="query_one" type="button">
							<i className="fa fa-search">查询</i>
						</button>
					</span>
		
	</div>
		<script type="text/javascript">
		$.backstretch("140629112642-13.jpg");
	</script>
					<div className="input-group">
					
				起始时间<input type="text" id="date1"value="">
				起始时间<input type="text" id="date2"value="">
							<button class="btn btn-default" id="query_look" type="button">
							查找
						</button>
					</span>
		
	</div></div>




	<div class="container">
		<div class="row" >
			
				<hr />
				
	</div></div>
	<div class="row">
	
	
		<div class="col-md-4">
			<div class="panel panel-warning">
				<div class="panel-heading">上传总数</div>
				<div class="panel-body" id="text2"></div>
			</div>
		</div>
		<div class="col-md-4">
			<div class="panel panel-warning">
				<div class="panel-heading">最近四笔添加</div>
				<div class="panel-body" id="list"></div>
			</div>
		</div>
	
		<div class="col-md-4">
			<div class="panel panel-warning">
				<div class="panel-heading">最近四笔查看</div>
				<div class="panel-body" id="list2"></div>
			</div>
		</div>
		
	
	</div>	<script type="text/javascript">
	$(function() {
		today = new Date();
		var date;
		var centry;
		centry = "";
		if (today.getFullYear() < 2000)
			centry = "19";
		date1 = (centry + (today.getFullYear()) + "-"
				+ (today.getMonth() + 1) + "-0" + "1");
		date2 = centry + (today.getFullYear()) + "-"
				+ (today.getMonth() + 1) + "-" + today.getDate();
		//document.write( date1+date2); 
         date1 : $('#date1').val(date1);
		 date2 : $('#date2').val(date2);
	$('#query_look').click(function() {
		$.getJSON('query_look.action', {
			date1 : $('#date1').val(),
			date2 : $('#date2').val()
		}, function(res, status) {
			var data = {'item' : res};
				var t = Handlebars.compile($('#template1').html());
				$('#text2').html(t(data));
		         })
			});
		});	
	</script> 
	<script type="text/javascript">
		$(function() {

			
			$.getJSON('query_add.action', function(res) {
				console.log(res);
				var data = {
					'item' : res
				};
				var t = Handlebars.compile($('#template').html());
				$('#list').html(t(data));
			});
		
			$.getJSON('query_see.action', function(res) {
				console.log(res);
				var data = {
					'item' : res
				};
				var t = Handlebars.compile($('#template').html());
				$('#list2').html(t(data));
			});
			});
	
	</script>
		<script type="text/x-handlebars-template" id="template">
    {{#each item}}
    <div class="panel panel-default col-md-3">
      <div class="panel-body">
        <dl>
           <dt>id</dt>   <dd>{{id}}</dd>
          <dt>档案号</dt>   <dd>{{archive_id}}</dd>
          <dt>身份证</dt>   <dd>{{identity}}</dd>
          <dt>姓名</dt>   <dd>{{name}}</dd>
          <dt>性别</dt><dd>{{gender}}</dd>
          <dt>出生日期</dt><dd>{{birthday}}</dd>
          <dt>预退休日期</dt>   <dd>{{date_retire1}}</dd>
          <dt>实际退休日期</dt>   <dd>{{date_retire2}}</dd>
          <dt>特殊工种</dt>   <dd>{{sp}}</dd>
          <dt>女管理岗位</dt>   <dd>{{fc}}</dd>
          <dt>职称</dt>   <dd>{{title}}</dd>
          <dt>工龄</dt>   <dd>{{seniority}}</dd>
       
       </dl>
     </div>
   </div>
   {{/each}}
 </script>
 
 <script type="text/x-handlebars-template" id="template1">
    {{#each item}}
    <div class="panel panel-default col-md-3">
      <div class="panel-body">
        <dl>
          <dt>数量</dt><dd>{{counter}}</dd>
       </dl>
     </div>
   </div>
   {{/each}}
 </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
	
	

	<script type="text/javascript">
	$(function() {
	$('#query_one').click(function() {
		$.post('query_one.action', {
			search : $('#search-box-value').val()
		}, function(res, status) {
			 if ('REE' == res) {
				alert('没有查到数据');
			}
			else if ('REE2' == res) {
				alert('请输入正确信息');
			}
			else{
				console.log(res);
			window.location.href = 'query_one.html?id='+res;
			}
		});
	});
		
	})
			
	</script> 
	
</body>
</html>
